Code Loading & Linking
نویسنده
چکیده
Code linking is a process of mapping identifiers used in the code to an actual implementations for execution. Different kinds and types of linking feature speed of execution, variability trade-offs and greatly influence possibilities of code reloading in the platform. Code loading is the process of referencing, locating and making the virtual machine level code accessible to the caller which is already loaded into the same virtual machine. Code loading mechanisms heavily depend on the representation of units of compilation that machine is using. Linking and loading techniques define code reloading capabilities and influence the existence of an industrial code reloading solutions for the given virtual machine. Why the problem is important Code binding, loading and linking are essential concepts for building multi-module applications, libraries and in fact any non-trivial program calls external libraries. Even if the call is to functions defined at the core of the language like to Java Class Library, which forms an essential part of the language, it should be considered an external call and require a compiler or a runtime to make a mapping between an identifier and an exact set of instructions that are be referenced by that identifier. We consider every identifier to be global, so any unit of compilation is able to call another unit of compilation by its identifier. The exact mechanism of distinguishing unit’s identifier from all others like: local variables, local function names, etc is not important and is omitted from the discussion. Once a virtual machine, VM, locates the exact instructions that represent an unit of compilation to load it begins the loading process. The usual activities done during that phase is: verification of the code, verification of the types and making sure the code is safe (in the VM sense), loading the code into the memory and making that unit of compilation available to already existing code. After that the code must be initialized and made ready to use by the caller. What is specific to this paper and what are expected results In this survey paper we describe the principles and implementations of several real-life choices about code binding, loading and reloading in several virtual machine platforms. When the solutions are dissected and investigated together, different trade-offs become clear and distinguishing features of every approach are seen clearer. Theoretical introduction, terms and principles, trade-offs For the better understanding of the code loading process we need to get back to the roots of the modern programming languages and describe how a program executes in a physical machine. A computer processor has a set of instructions that are implemented in hardware and can be executed sequentially by this hardware. So essentially any program is a specification which instruction should be executed and in which order. A program specified as a sequence of such instructions is referred as a machine code. As the hardware is the only physical entity involved into the computation, it is the only entity which is capable of executing a program. In spite of this any program, written in any representation must be converted to a machine code prior the execution. It is perfectly valid to create and write programs in the machine code directly, however this approach tends to be very cumbersome, as modern programs consist of thousands of machine code instructions. To solve this problem a compiler is used. A compiler is a tool for translation process from a higher, more abstract programming language into a lower level set of instructions, which is called compilation.
منابع مشابه
Flexible , source level dynamic linking and re - linking � – Work in Progress –
We give a formal semantics for dynamic linking and re-linking of code. The semantics is at source language level, and allows linking at a finer grain than current Java or C# implementations: Besides supporting the loading and verification of classes interleaved with program execution, it also allows type-safe removal and replacement of classes, fields and methods. Such extended features support...
متن کاملDynamic Loading in an Application Specific Embedded Operating System
Traditionally, configuration of operating systems is done statically at compileor link-time, but recently dynamic runtime configuration has become possible. Embedded systems however have constraints, such as limited memory and real-time requirements, that prevent many dynamically configurable operating systems from being used in an embedded system. Dynamic configuration has associated limitatio...
متن کاملProof Linking: An Architecture for Modular Veri cation of Dynamically-Linked Mobile Code
Security aws are routinely discovered in commercial implementations of mobile code systems such as the Java Virtual Machine (JVM). Typical architectures for such systems exhibit complex interdependencies between the loader, the ver-iier, and the linker, making them diicult to craft, validate, and maintain. This reveals a software engineering challenge that is common to all mobile code systems i...
متن کاملSafe and Flexible Dynamic Linking of Native Code
We present the design and implementation of the first complete framework for flexible and safe dynamic linking of native code. Our approach extends Typed Assembly Language with a primitive for loading and typechecking code, which is flexible enough to support a variety of linking strategies, but simple enough that it does not significantly expand the trusted computing base. Using this primitive...
متن کاملA Calculus for Dynamic Loading
We present the load-calculus, used to model dynamic loading, and prove it sound. The calculus extends the polymorphic λ-calculus with a load primitive that dynamically loads terms that are closed, with respect to values. The calculus is meant to approximate the process of dynamic loading in TAL/Load [4], an version of Typed Assembly Language [7] extending with dynamic linking. To model the key ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012